home *** CD-ROM | disk | FTP | other *** search
- /* HEAP.H - Include file for the Heap Library
- */
-
- /* Global type definitions
- */
- typedef unsigned char uchar;
- typedef unsigned long ulong;
- typedef unsigned int uint;
- typedef char far* fptr;
- typedef char huge* hptr;
-
- /* Global definitions
- */
- #define ERR_NOTINIT 1 /* InitHeap() was not called */
- #define ERR_ALREADYINIT 2 /* InitHeap() was already called */
- #define ERR_SIZETOOSMALL 3 /* Requested size too small */
- #define ERR_SIZETOOLARGE 4 /* Requested size too large */
- #define ERR_TOOMANYHAND 5 /* Too many handles already used */
- #define ERR_HANDNOTFOUND 6 /* Requested handle not found */
-
- /* Global variables
- */
- extern const char *HeapVersion; /* Version of this library */
- extern const uchar HeapInitialized; /* Set by InitHeap() */
- extern const uint HeapMaxHandles, /* Maximum handles allocatable */
- HeapUsedHandles; /* Total handles alloc. by Halloc() */
- extern const ulong HeapUsed, /* Total memory alloc. by Halloc() */
- HeapUnused; /* Total mem. available by Halloc() */
-
- extern uchar HeapError; /* Set after all functions */
- extern hptr HeapBase; /* Base of memory alloc()'d */
-
- /* Global function prototypes
- */
- extern uchar InitHeap(uint handles, ulong bytes); /* Init. all variables */
- extern void UnInitHeap(void); /* Uninit all variables*/
- extern uint Halloc(ulong bytes); /* Alloc memory */
- extern uchar Hfree(uint handle); /* Free memory */
- extern ulong Hsize(uint handle); /* Return memory size */
- extern hptr Hpointer(uint handle); /* Return mem. pointer */
- extern void Hclear(void); /* Re-init all variabls*/
-